{extend name="admin@index_layout"/}
{block name="main"}
<link rel="stylesheet" href="__STATIC__/admin/css/cms.css">
<div class="layui-card">
	<div class="layui-card-body layui-form-pane">
		<form class="layui-form form-horizontal" action="" method="post">
			<div class="layui-form-item">
				<label class="layui-form-label">站点名称</label>
				<div class="layui-input-block">
					<input type="text" name="name" autocomplete="off" placeholder="" class="layui-input" value="{$data.name}">
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">语言标识</label>
				<div class="layui-input-inline">
					<input autocomplete="off" class="layui-input" id="mark" name="mark" placeholder="语言标识" type="text" value="{$data.mark}"></input>
				</div>
				<div class="layui-input-inline">
					<select lay-filter="fasttype">
						<option data-mark="zh-cn">常用语言标识</option>
						<option data-mark="zh-cn">简体中文</option>
						<option data-mark="en-gb">English</option>
						<option data-mark="ja-jp">Japanese</option>
						<option data-mark="ar-ar">اللغة العربية</option>
						<option data-mark="fr-fr">French</option>
						<option data-mark="de-de">Deutsch</option>
						<option data-mark="es-es">Espanol</option>
						<option data-mark="ru-ru">Russia</option>
						<option data-mark="ot-la">其他语言</option>
					</select>
				</div>
				<div class="layui-form-mid layui-word-aux">
					多语言选相应的语言就行，如果站群，选相应的语言就行
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">绑定域名</label>
				<div class="layui-input-inline">
					<select name="http" lay-verify="required">
						<option value=""></option>
						<option value="https" {if $data['http']='https'}selected{/if}>https://</option>
						<option value="http" {if $data['http']='http'}selected{/if}>http://</option>
					</select>
				</div>
				<div class="layui-input-inline">
					<input type="text" name="domain" autocomplete="off" placeholder="en.dzdcms.com" class="layui-input" value="{$data.domain}">
				</div>
				<div class="layui-form-mid layui-word-aux">
					域名只支持二级域名或顶级域名，不可有子目录
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">上级站点</label>
				<div class="layui-input-block">
					<select name="parentid">
						<option value="0">作为顶级站点</option>
						{$site|raw}
					</select>
				</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">品牌名称</label>
				<div class="layui-input-block">
					<input type="text" name="brand" autocomplete="off" placeholder="" class="layui-input" value="{$data.brand}">
				</div>
				<div class="layui-form-mid layui-word-aux">如:多站点</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">SEO标题</label>
				<div class="layui-input-block">
					<input type="text" name="title" autocomplete="off" placeholder="" class="layui-input" value="{$data.title}">
				</div>
				<div class="layui-form-mid layui-word-aux">网页的title值</div>
			</div>

			<div class="layui-form-item">
				<label class="layui-form-label">关键词</label>
				<div class="layui-input-block">
					<input type="text" name="keywords" autocomplete="off" placeholder="" class="layui-input" value="{$data.keywords}">
				</div>
				<div class="layui-form-mid layui-word-aux">网页的keywords值</div>
			</div>
			<div class="layui-form-item web_seo">
				<label class="layui-form-label">站点描述</label>
				<div class="layui-input-block">
					<textarea name="description" placeholder="网站简介" class="layui-textarea">{$data.description}</textarea>
				</div>
				<div class="layui-form-mid layui-word-aux">网页的description值</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">网站Logo</label>
				<div class="layui-input-block layui-upload">
					{php}echo \util\Form::images('logo','',$data['logo']){/php}
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">网站图标</label>
				<div class="layui-input-block layui-upload">
					{php}echo \util\Form::images('favicon','',$data['favicon']){/php}
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">主题风格</label>
				<div class="layui-input-block">
					<select name="template">
						<option value="">请选择主题风格</option>
						{volist name="templates" id="vo"}
						<option value="{$vo.name}" {eq name="vo.name" value="$data.template" }selected{/eq}>{$vo.name}</option>
						{/volist}
					</select>
				</div>
				<div class="layui-form-mid layui-word-aux">模版请先上传到template下面并包含info.ini文件</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">排序</label>
				<div class="layui-input-block">
					<input type="number" name="listorder" autocomplete="off" placeholder="排序" class="layui-input" value="{$data.listorder}">
				</div>
			</div>
			<div class="layui-form-item">
				<label class="layui-form-label">状态</label>
				<div class="layui-input-block">
					<input type="radio" name="status" value="1" {eq name="data.status" value="1" }checked{/eq} title="开启" lay-filter="status">
					<input type="radio" name="status" value="0" {eq name="data.status" value="0" }checked{/eq} title="关闭" lay-filter="status">
				</div>
			</div>

			<input name="id" type="hidden" value="{$data.id}">
			<div class="layui-form-item layer-footer">
				<div class="layui-input-block">
					<button class="layui-btn" lay-submit>立即提交</button>
					<button type="reset" class="layui-btn layui-btn-primary">重置</button>
				</div>
			</div>
		</form>
	</div>
</div>
{/block}
{block name="script"}
<script type="text/javascript">
	layui.use(['form','yznForm'], function() {
		var yznForm = layui.yznForm;
		var form = layui.form;
		yznForm.listen();

		form.on('select(fasttype)', function(data) {
			$('#mark').val($(data.elem).find("option:selected").attr("data-mark"));
		});
	});
</script>
{/block}